package com.ivan.toolkit.common;

import com.ivan.toolkit.common.Events;

public class Debug {
	
	public static final String KEY = "DEBUG";
	
	public static void fire(String source, String content) {
		
		Events e = new Events("DEBUG");
		e.put("time", System.currentTimeMillis());
		e.put("source", source);
		e.put("content", content);
		
		Events.post(e);
	}
	
	public static boolean match(Events event) {
		return event.getKey().equals("DEBUG");
	}
	
	public static long time(Events event) {
		return event.get("time", Long.class);
	}
	
	public static String source(Events event) {
		return event.get("source", String.class);
	}
	
	public static String content(Events event) {
		return event.get("content", String.class);
	}

}
